﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Styles/Site.Master" AutoEventWireup="true" CodeBehind="AddProduct.aspx.cs" Inherits="Shop4Aggies.AddProduct" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="AddProduct">
        <table>
            <tr>
                <td class="AddProductTableTD">
                    Product Name:
                </td>
                <td>
                    <asp:TextBox ID="ProductName" runat="server" Width="313px"></asp:TextBox>
                    <br />
                    <asp:Label ID="ErrorName" runat="server" Text="" CssClass="ErrorText" />
                </td>
            </tr>
            <tr>
                <td class="AddProductTableTD">
                    Description:
                </td>
                <td>
                    <asp:TextBox ID="Description" runat="server" Height="139px" Width="313px" 
                        TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="AddProductTableTD">
                    Category:
                </td>
                <td>
                    <asp:DropDownList ID="Category" runat="server" 
                        DataSourceID="EDM_Category_List" DataTextField="CategoryName" 
                        DataValueField="CategoryID"></asp:DropDownList>
                    <asp:EntityDataSource ID="EDM_Category_List" runat="server" 
                        ConnectionString="name=CommerceEntities" 
                        DefaultContainerName="CommerceEntities" EnableFlattening="False" 
                        EntitySetName="Categories" EntityTypeFilter="Category">
                    </asp:EntityDataSource>
                </td>
            </tr>
            <tr>
                <td class="AddProductTableTD">
                    Price:
                </td>
                <td>
                    <asp:TextBox ID="UnitPrice" runat="server" Width="50px"></asp:TextBox>
                    <asp:Label ID="ErrorPrice" runat="server" Text="" CssClass="ErrorText" />
                </td>
            </tr>
            <tr>
                <td class="AddProductTableTD">
                    Image:
                </td>
                <td style="text-align:right">
                    <asp:FileUpload ID="ImageUpload" Height="21" Width="316" runat="server" />
                    <br />
                    <asp:Label ID="ErrorUpload" runat="server" Text="" CssClass="ErrorText" />
                    <asp:Button OnClick="BtnImageUpload_Click" ID="BtnImageUpload" Width="81" 
                        Height="21" Text="Upload" runat="server" UseSubmitBehavior="False" />
                </td>
            </tr>
            <tr>
                <td class="AddProductTableTD">
                    Preview:
                </td>
                <td>
                    <asp:Image ID="ImgPreview" runat="server" AlternateText="No file uploaded" Height="200" Width="300" ImageUrl="~/Catalog/Images/image.gif" />
                </td>
            </tr>
            <tr>
                <td />
                <td style="text-align:right">
                    <asp:Button ID="BtnAddProduct" runat="server" Text="List Product" 
                        onclick="BtnAddProduct_Click" UseSubmitBehavior="False" />
                </td>
            </tr>
        </table>
    </div>
    <asp:HiddenField ID="HiddenImgName" Value="image.gif" runat="server" />
</asp:Content>
